/**
 * @author Haidar Osman
 */
var RelationObjArray = function()
{
	// this.parentShape=parentShape;
	this.members=[];
	var that=this;
	this.addRelation=function(relationObj)
	{
		this.members[this.members.length]=relationObj;		
	}
	this.removeRelation=function(fromClassObj,toClassObj)
	{
		var i=0;
		for(i=0;i<that.members.length;i++)
		{
			if(that.members[i].fromClass.name==fromClassObj.name)
			{
				if(that.members[i].toClass.name==toClassObj.name)
				{
					that.members.splice(i,1);
				}
			}
		}
	}
	
	this.getRelation=function(fromClassObj,toClassObj)
	{
		var i = 0;
		for( i = 0; i < that.members.length; i++) {
			if(that.members[i].fromClass.name == fromClassObj.name) {
				if(that.members[i].toClass.classObj.name == toClassObj.name) {
					return that.members[i];
					break;
				}
			}
		}	
		return null;
	}
}
